﻿@using BootstrapBlazor.Shared.Samples;
@using System.ComponentModel;
@inject IStringLocalizer<Switchs> Localizer

<div class="row g-3">
    <div class="col-12">
        <Switch OnColor="Color.Success" OffColor="Color.Danger" OnText="@Localizer["SwitchsOnText"]" OffText="@Localizer["SwitchsOffText"]" @bind-Value="@Model.BindValue" DisplayText="@Localizer["SwitchsBindingDisplayText1"]"></Switch>
    </div>
    <div class="col-12">
        <div>@Localizer["SwitchsBindingDivText1"]: @Model.BindValue</div>
    </div>
    <Divider Text="@Localizer["SwitchsBindingDividerText1"]" />
    <div class="col-12">
        <p>@((MarkupString)Localizer["SwitchsBindingTips1"].Value)</p>
    </div>
    <div class="col-12">
        <Switch OnColor="Color.Success" OffColor="Color.Danger" OnText="@Localizer["SwitchsOnText"]" OffText="@Localizer["SwitchsOffText"]" @bind-Value="@Model.BindValue" DisplayText="@Localizer["SwitchsBindingDisplayText2"]" ShowLabel="true"></Switch>
    </div>
    <Divider Text="@Localizer["SwitchsBindingDividerText2"]" />
    <div class="col-12">
        <p>@((MarkupString)Localizer["SwitchsBindingTips2"].Value)</p>
    </div>
    <div class="col-12">
        <Switch OnColor="Color.Success" OffColor="Color.Danger" OnText="@Localizer["SwitchsOnText"]" OffText="@Localizer["SwitchsOffText"]" @bind-Value="@Model.BindValue" ShowLabel="true"></Switch>
    </div>
    <Divider Text="@Localizer["SwitchsBindingDividerText3"]" />
    <div class="col-12">
        <p>@((MarkupString)Localizer["SwitchsBindingTips3"].Value)</p>
    </div>
    <div class="col-12">
        <Switch OnColor="Color.Success" OffColor="Color.Danger" OnText="@Localizer["SwitchsOnText"]" OffText="@Localizer["SwitchsOffText"]" @bind-Value="@Model.BindValue" DisplayText="@Localizer["SwitchsBindingDisplayText3"]" ShowLabel="false"></Switch>
    </div>
</div>

@code {
    private class Foo
    {
        [DisplayName("绑定标签")]
        public bool BindValue { get; set; }
    }

    private Foo Model { get; set; } = new Foo();
}
